const express = require("express")
const service = require("./service.js")
const router = express.Router()

//提供所有的图书信息
router.get("/books", service.allBooks)

//删除图书信息
router.delete("/books/book/:id", service.deleteBook)

//编辑图书时根据id查询响应的信息
router.get("/books/book/:id", service.getBookById)

//提交编辑的数据
router.put("/books/book", service.editBook)

//添加图书时提交数据
router.post("/books/book", service.addBook)

module.exports = router